package com.example.design.patterns.冰河.行为模式.策略模式.context;

import com.example.design.patterns.冰河.行为模式.策略模式.strategy.Strategy;

/**
 * Context 用一个 ConcreteStrategy对象来配置.维护一个对Strategy对象的引用.
 * 可定义一个接口让Stategy访问它的数据
 */
public class Context {
    Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    public void doMethod() {
        this.strategy.method();
    }
}
